//
//  ViewController.m
//  CodeForConstraint
//
//  Created by 李明明 on 15/10/19.
//  Copyright © 2015年 李明明. All rights reserved.
//

#import "ViewController.h"
#import "UIView+YView.h"
#import "LManagerProperty.h"
//
#define SYSTEM_VERSION_EQUAL_TO(v)                  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v)              ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v)                 ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    UIView *view = [[UIView alloc] init];
    view.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:view];

    LManagerProperty *managerPro = [[LManagerProperty alloc] init];
    managerPro.leading = 100;
    managerPro.trailing = 100;
    managerPro.top = 100;
    managerPro.height = 100;
    [view makeConstraintWith:self.view withProperty:managerPro];
    UIView *view1 = [[UIView alloc] init];
    view1.backgroundColor = [UIColor greenColor];
    managerPro.leading = 10;
    managerPro.trailing = 100;
    managerPro.top = 200;
    managerPro.height = 100;
    [self.view addSubview:view1];
    [view1 makeConstraintWith:self.view withProperty:managerPro];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
